package com.px.user.mapper;

import com.px.user.entity.Roles;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RolesMapper {

    @Update("update roles set role=ifnull(#{role},role),name=ifnull(#{name},name) where id=#{id}")
    void update(Roles roles);

    @Delete("delete from roles where id=#{id}")
    void delete(Long id);

    @Select("select * from roles")
    List<Roles> findAll();
}
